//
//  CustomSearch.m
//  K-Music
//
//  Created by LoGUYU on 16/1/15.
//  Copyright © 2016年 CHUN. All rights reserved.
//

#import "CustomSearch.h"

@implementation CustomSearch

/**
 *  自定义输入框
 *
 *  @param left  左边图标
 *  @param right 右边图标
 *  @param str   提示文件
 *  @param Fsize 字体大小
 *  @param btn   是否开启一键删除
 */
-(void)CustomSearchLeftImage:(UIView *)left RightImage:(UIView *)right ShowString:(NSString *)str FontSize:(CGFloat)Fsize ClearBtn:(BOOL)btn
{
    //左边图标
    self.leftView = left;
    //右边图标
    self.rightView = right;
    //提示字体
    self.placeholder = str;
    //字体大小
    self.font = [UIFont systemFontOfSize:Fsize];
    //是否开启一键删除
    self.clearButtonMode = btn;
    //是指左边图案显示
    self.leftViewMode = UITextFieldViewModeAlways;
    
}


//图片的偏移
- (CGRect) leftViewRectForBounds:(CGRect)bounds
{
    CGRect iconRect = [super leftViewRectForBounds:bounds];
    iconRect.origin.x += 10;// 右偏10
//    iconRect.origin.y -= 3;
    return iconRect;
}

@end
